// Copyright (c) 2005  INRIA Sophia-Antipolis (France).
// All rights reserved.
//
// This file is part of cgal-python; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; version 2.1 of the License.
// See the file LICENSE.LGPL distributed with cgal-python.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// $Id: Kernel_module.cpp 198 2009-03-17 13:27:53Z spion $
// $URL: svn+ssh://scm.gforge.inria.fr/svn/cgal-python/trunk/cgal-python/bindings/Kernel/Kernel_module.cpp $
//
// Author(s)     : Naceur Meskini
//=========================================================================

#include <CGAL/basic.h>
#if CGAL_VERSION_NR >= CGAL_VERSION_NUMBER(3,4,0)
#  include <CGAL/assertions_behaviour.h>
#endif
#include <include/cgal_exception.h>

#include <CGAL/Gmpq.h>
#include <CGAL/Lazy_exact_nt.h>

#include <boost/python.hpp>
#include <boost/cstdint.hpp>

extern void export_Aff_transformation_2();
extern void export_Aff_transformation_3();
extern void export_Circle_2();
extern void export_Direction_2();
extern void export_Direction_3();
extern void export_Enumerations();
extern void export_global_functions_2();
extern void export_global_functions_3();
extern void export_Global_variables();
extern void export_Iso_cuboid_3();
extern void export_Iso_rectangle_2();
extern void export_Line_2();
extern void export_Line_3();
extern void export_Plane_3();
extern void export_Point_2();
extern void export_Point_3();
extern void export_Ray_2();
extern void export_Ray_3();
extern void export_Segment_2();
extern void export_Segment_3();
extern void export_Sphere_3();
extern void export_Tetrahedron_3();
extern void export_Triangle_2();
extern void export_Triangle_3();
extern void export_Vector_2();
extern void export_Vector_3();
// extern void export_Gmpq();
extern void export_Bbox_3();
extern void export_Bbox_2();

using namespace boost::python;

typedef CGAL::Lazy_exact_nt<CGAL::Gmpq> FT;
class FT_to_double
{
	public:
    static PyObject* convert(FT const& x)
    {
		return boost::python::incref(boost::python::object(CGAL::to_double(x)).ptr());
    }
};

BOOST_PYTHON_MODULE(Kernel)
{
	CGAL::set_error_handler(python_cgal_error_handler);
	to_python_converter<FT, FT_to_double>();
// 	export_Gmpq();	
	export_Aff_transformation_2();
	export_Aff_transformation_3();
	export_Enumerations();
	export_Global_variables();
	export_Circle_2();
	export_Direction_2();
	export_Direction_3();
 	export_global_functions_2();
 	export_global_functions_3();
//	export_Iso_cuboid_3();
	export_Iso_rectangle_2();
	export_Line_2();
	export_Line_3();
	export_Plane_3();
	export_Point_2();
	export_Point_3();
	export_Ray_2();
	export_Ray_3();
	export_Segment_2();
	export_Segment_3();
	export_Sphere_3();
	export_Tetrahedron_3();
	export_Triangle_2();
	export_Triangle_3();
	export_Vector_2();
	export_Vector_3();
	export_Bbox_3();
	export_Bbox_2();
}
